package br.com.seuimovelnamao.dao;

import org.hibernate.Session;

public abstract class MasterDAO {
	
	Session session;
	
	public MasterDAO(Session session){
		this.session = session;
	}
	
	public Session getSession(){
		return this.session;
	}

	public void salva(Object o) throws Exception{
		this.getSession().beginTransaction();
		this.getSession().save(o);
		this.getSession().getTransaction().commit();
	}
	
	public void atualiza(Object o) throws Exception{
		this.getSession().beginTransaction();
		this.getSession().update(o);
		this.getSession().getTransaction().commit();
	}
	
}
